package qingke.bean;

public class Admin {

	private static Admin admin;

	private static boolean key = true;

	private static String adminName;

	private static String adminPassword;

	private Admin() {
		adminName = "admin";
		adminPassword = "admin";
	}

	public synchronized static Admin getAdmin() {
		if (key) {
			if (admin == null) {
				admin = new Admin();
				key = false;
				return admin;
			} else {
				return admin;
			}
		}
		return null;
	}

	public String getAdminName() {
		return adminName;
	}

	public void setAdminName(String adminName) {
		Admin.adminName = adminName;
	}

	public String getAdminPassword() {
		return adminPassword;
	}

	public void setAdminPassword(String adminPassword) {
		Admin.adminPassword = adminPassword;
	}

	public static boolean isKey() {
		return key;
	}

	public static void recycleAdmin() {
		key = true;
	}

	@Override
	public String toString() {
		return "Admin [getClass()=" + getClass() + ", hashCode()=" + hashCode() + ", toString()=" + super.toString()
				+ "]";
	}

}
